package com.atguigu.yygh.mq;

import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * ClassName: RabbitConfig
 * Package: com.atguigu.yygh.mq
 * Description:
 *
 * @Author: cqk
 * @Create: 2023/10/6 - 10:47
 * @Version: v1.0
 */
@Configuration
public class RabbitConfig {

    @Bean//将发送到rabbitmq的pojo对象自动转化为json存储    消费消息时将jsOn对象转化为pojo对象
    public MessageConverter getMessageConverter(){
        return new Jackson2JsonMessageConverter();
    }
}
